/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.cabarrus.xltosql.util;

import java.awt.Frame;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFileChooser;

/**
 *
 * @author moscac
 */
public class XLUtility {
    
    public XLUtility() {
        
    }

    public boolean selectSpreadsheet(Frame parent) {
        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle("Select spreadsheet");
        int retVal = fc.showOpenDialog(fc);
        if (retVal != JFileChooser.APPROVE_OPTION) {
            return false;
        }
        System.out.println(fc.getSelectedFile().getAbsolutePath());
        SelectXLColumnsDialog dialog = new SelectXLColumnsDialog(parent, true);    
        dialog.setVisible(true);
        return false;
    }
            
    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public List<String> getColumnNames() {
        return columnNames;
    }

    public void setColumnNames(List<String> columnNames) {
        this.columnNames = columnNames;
    }
    
    private List<String> columnNames = new ArrayList<String>(0);
    private String fileName;
}
